//
//  ViewController.m
//  navDemo
//
//  Created by hfzhangzhang on 2018/3/29.
//  Copyright © 2018年 hfzhangzhang. All rights reserved.
//

#import "ViewController.h"
#import "TViewController.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    if (@available(iOS 11.0, *)) {
        self.navigationController.navigationBar.prefersLargeTitles = YES;
    } else {
        
    }//这句话表示是否显示大标题
    
    self.navigationItem.title = @"设置";//设置标题
    
    if (@available(iOS 11.0, *)) {
        self.navigationItem.largeTitleDisplayMode = UINavigationItemLargeTitleDisplayModeAutomatic;
    } else {
       
    }//这个是标题显示的方式，下面会详细的说
    
    
    UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
    btn.frame = CGRectMake(0, 100, 100, 100);
    [btn addTarget:self action:@selector(btn) forControlEvents:UIControlEventTouchUpInside];\
    btn.backgroundColor = [UIColor redColor];
    [self.view addSubview:btn];
    
}
-(void)btn{
    TViewController *vi =[[TViewController alloc]init];
    [self.navigationController pushViewController:vi animated:YES];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
